package com.xhs.modular.user.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.core.trans.anno.Trans;
import org.dromara.core.trans.constant.TransType;
import org.dromara.core.trans.vo.TransPojo;

import java.io.Serializable;
import java.util.Date;

/**
 * @desc: 系统用户表 实体类。
 * @projectName: spring-boot3-demo
 * @author: xhs
 * @date: 2025-06-09 周一 15:11
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("sys_user")
public class SysUserEntity implements Serializable, TransPojo {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 密码
     */
    private String password;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 工号
     */
    private String jobNumber;

    /**
     * 邮箱
     */
    private String mailbox;

    /**
     * 部门id
     */
    private Integer departmentId;

    /**
     * 性别 0:女,1:男,2:保密
     */
    @Trans(type = TransType.DICTIONARY, key = "gender")
    private Integer gender;

    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 任职状态 0:在职,1:离职
     */
    @Trans(type = TransType.DICTIONARY, key = "employmentStatus")
    private Integer employmentStatus;

    /**
     * 账号状 0:正常,1:冻结
     */
    @Trans(type = TransType.DICTIONARY, key = "accountStatus")
    private Integer accountStatus;

    /**
     * 删除状态  0:正常,1:删除
     */
    private String isDeleted;

    /**
     * 创建人id
     */
    private Integer createUserId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    /**
     * 创建部门
     */
    private Integer createDepartmentId;

    /**
     * 修改人id
     */
    private Integer modifyUserId;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifiedTime;

    /**
     * 修改部门
     */
    private Integer modifyDepartmentId;
}
